import request from '@/utils/request'

// 查询收付款申请单列表
export function listApply(query) {
  return request({
    url: '/settle/paymentApply/list',
    method: 'post',
    data: query
  })
}

// 查询收付款申请单详细
export function getApply(id) {
  return request({
    url: '/settle/paymentApply/' + id,
    method: 'get'
  })
}

// 新增收付款申请单
export function addApply(data) {
  return request({
    url: '/settle/paymentApply/add',
    method: 'post',
    data: data
  })
}
// 新增收付款申请单
export function addPaymentApplyByPurOrder(data) {
  return request({
    url: '/settle/paymentApply/addPaymentApplyByPurOrder',
    method: 'post',
    data: data
  })
}

// 修改收付款申请单
export function updateApply(data) {
  return request({
    url: '/settle/paymentApply/update',
    method: 'post',
    data: data
  })
}

// 删除收付款申请单
export function delApply(id) {
  return request({
    url: '/settle/paymentApply/delete/' + id,
    method: 'post'
  })
}
//审核申请单
export function audit(id){
  return request({
    url: '/settle/paymentApply/audit/' + id,
    method: 'post'
  })
}
//取消审核申请单
export function auditCancel(id){
  return request({
    url: '/settle/paymentApply/auditCancel/' + id,
    method: 'post'
  })
}

// 申请单关闭
export function close(data) {
  return request({
    url: '/settle/paymentApply/close',
    method: 'post',
    data: data
  })
}